home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 15 / develop 15 code / 3D Interface / 3D Buttons CDEF / Source / 3D Buttons CDEF source / 3D Buttons CDEF Source Read Me next >
Encoding:
Text File  |  1994-07-04  |  1.5 KB  |  29 lines  |  [TEXT/ttxt]

  1. 3D Buttons CDEF, by Zig Zichterman
  2. 1.0b1 4 July 1994
  3.  
  4. 3D Buttons is a control definition (CDEF) that implements the 3D interface as suggested in develop issue 15. When drawing on a 8-bit (or breater) color device (in a color GrafPort), 3D Buttons draws in grey. 3D Buttons drops to normal 2D drawing for black and white (or less than 8 bits of color).
  5.  
  6. The source for the 3D Buttons CDEF is broken into
  7. •  the main entry function:
  8.       3D Buttons CDEF.cp
  9. •  classes for 4 button variants:
  10.       LGBPushButtons
  11.       LGBCheckbox
  12.       LGBRadio
  13.       LIconButton
  14. •  utility functions:
  15.       LGBControl
  16.       LGBDeviceIterator
  17.       UGBDraw
  18.  
  19. [The "GB" stands for "Grey Buttons," which is what I originally called the project.]
  20.  
  21. I wrote this function in C++, but without any C++ features that require the C++ runtime engine. The CDEF is smaller and faster without all that overhead.
  22.  
  23. Every function call into the CDEF comes through the main entry point in 3D Buttons CDEF.cp. Main() switches on the button variation and passes control to the entry point for one of the 4 button variations.
  24.  
  25. Each button variation has a main entry point that switches on the CDEF message. There are only 4 messages that button CDEFs pay attention to: draw, hit test, and 2 messages to calculate the button region.
  26.  
  27. Most of the code in each button variation is devoted to drawing the buttons. Drawing functions just save the current drawing environment, then loop through the device list, drawing either color or black and white depending on the device (screen) depth.
  28.  
  29.